import QtQuick 1.1

import "Tools"
Rectangle {
    id: main
    width: 640
    height: 500

    Column{
        id: column1
        width: 300
        height: 400
        anchors.left: parent.left
        anchors.leftMargin: 0
        anchors.top: parent.top
        anchors.topMargin: 0
        LineEdit{
            id: lineEntreprise
            y: 0
            height: 100
            anchors.right: parent.right
            anchors.rightMargin: 0
            anchors.left: parent.left
            anchors.leftMargin: 0
            backText: "Entreprise"
        }

        LineEdit {
            id: lineAdresse
            y: 105
            height: 100
            anchors.right: parent.right
            anchors.rightMargin: 0
            anchors.left: parent.left
            anchors.leftMargin: 0
            backText: "Adresse"
        }
        Button{
            id: button
            y: 380
            height: 100
            anchors.left: parent.left
            anchors.leftMargin: 0
            anchors.right: parent.right
            anchors.rightMargin: 0
            btnName: "Ajouter"
            txtSize: 20
            MouseArea {
                anchors.fill: parent
                onClicked: listFacture.myModel.append({"nom_entreprise":lineEntreprise.inputText,"adresse":lineAdresse.inputText})
            }
        }
        Button {
            id: buttonSelect
            y: 480
            height: 100
            anchors.left: parent.left
            anchors.leftMargin: 0
            anchors.right: parent.right
            anchors.rightMargin: 0
            btnName: "Voir la facture"
            txtSize: 20
            MouseArea {
                anchors.fill: parent
                //onClicked: listFacture.name_source="http://beter.hd.free.fr:1723/ERP/request_2.php"
            }
        }
    }
    ListFacture{
        id: listFacture
        x: 300
        y: 0
        anchors.left: column1.right
        anchors.leftMargin: 0
        anchors.bottom: parent.bottom
        anchors.bottomMargin: 0
        anchors.right: parent.right
        anchors.rightMargin: 0
        anchors.top: parent.top
        anchors.topMargin: 0

    }

}
